32. Exercise: Create the SettingsActivity in Sunshine

Create the Settings Activity in Sunshine

Create the SettingsActivity in Sunshine

In this exercise, you'll create a blank SettingsActivity and open it via Sunshine's ActionBar menu.

Exercise Code

Exercise: S06.01-Exercise-LaunchSettingsActivity

Create The Settings Activity

Complete the following steps to create and link the navigation for a settings activity.

SOLUTION:
  • Create a new SettingsActivity class.
  • Add an item to the menu of the MainActivity and the DetailActivity which opens the SettingsActivity.
  • The up button is displayed on the SettingsActivity.
  • When navigating back from the SettingsActivity, the previous activity should be used and not a new instance.